<template>
  <div class="panel-body">
    <div>
      <h2>Home组件内容</h2>
      <div>
        <ul class="nav nav-tabs">
          <li>
            <router-link class="list-group-item" active-class="active" to="/home/news">News</router-link>
          </li>
          <li>
            <router-link class="list-group-item" active-class="active" to="/home/message">Message</router-link>
          </li>
        </ul>
        <router-view></router-view>
      </div>
    </div>
  </div>
</template>

<script>
import Message from "./Message";
import News from "./News";
export default {
    name:"Home",
    components:{
      Message,
      News
    },
    mounted() {
      // 当再次回到该路由，则会再次挂载！
      // console.log("Home路由挂载完毕");
    },
    beforeDestroy() {
      // 路由在被切换掉后实际上默认被销毁了！
      // console.log("Home路由被销毁")
    },
}
</script>